extends CardState

@export var style:StyleBoxTexture

func on_mouse_entered():
	transition_requested.emit(self, State.STATE_HOVER)
	
func enter() -> void:
	if !get_parent().trophy_mode:
		if card_view.card_container != null:
			card_view.card_container.organize_cards.emit(false, false, false, card_view)
	card_view.border_panel.set("theme_override_styles/panel", card_view.HAND_STYLEBOX)

func update_transform(in_hand_rotation, in_hand_position, _in_hand_hover_position):	
	card_view.z_index = 0
	if card_view.tween:
		card_view.tween.kill() # 终止之前的补间动画。
	
	card_view.tween = card_view.create_tween()
	
	var tween : Tween = card_view.tween
	tween.set_parallel()
	tween.tween_property(card_view, "rotation", in_hand_rotation, 0.1)
	tween.tween_property(card_view, "position", in_hand_position, 0.1)
	tween.play()
	
